<#include "include/_meta.html">
<title>订单管理</title>
</head>
<body>
<div class="page-container">
	<form class="form form-horizontal" id="form-admin-add" >
	<div style="width: 1150x;margin:0 auto;" id="userListTable" class="cl pd-5 bg-1 bk-gray mt-20" >
		<div style="width: 1150px;">
				<table  height="500" class="cl pd-5 bg-1 bk-gray mt-20">
					<tr width="200" height="50px">
						<td >订单号：${(info.orderid)!''}</td>
						<td colspan="3" >客户手机：${(client.mobile)!''}</td>
					</tr>
					<tr width="200" height="50px">
						<td rowspan="4" width="300"><img src="${(picurl)!'images'}/${(picname)!'1.jpg'}" alt="汽车图片" style="width:200px;height:200px;"/></td>
						<td width="250" >车辆类型：${(car.carbrand)!''}</td>
						<td width="250">手动/自动:<#if car.isauto==1>手动</#if>
												<#if car.isauto==0>自动</#if>/排量:${(car.enginesize)!''}T/座位数:${(car.seatnum)!''}</td>
						<th width="350"><b>费用明细：</b></th>
					</tr>
					<tr width="200" height="50px">
						<th><b>取车地:</b></th>
						<th><b>还车地:</b></th>
						<td id="realrent" >租赁费用：￥${(info.realrent)!''}</td>
					</tr>
					<tr width="200" height="50px">
						<td>取车门店：${(info.btrentdept)!''}</td>
						<td>还车门店：${(info.etrentdept)!''}</td>
						<td>基本保险：￥${(info.realbasic)!''}</td>
					</tr>
					<tr width="200" height="50px">
						<td>取车时间：${(info.readybttime)!''}</td>
						<td>还车时间：${(info.readettime)!''}</td>
						<td>总计：￥${(sumMoney)!''}</td>
					</tr>
					<tr width="200" height="50px">
						<td text-align="center">车辆图片</td>
						<td>详细地址：${(info.btrentdept)!''}</td>
						<td>详细地址：${(info.btrentdept)!''}</td>
						<td>实际预售押金：￥${(carPrice.tempmoney)!''}</td>
					</tr>
					<tr width="200" height="50px">
						<td colspan="3">租期：${(day)!''}天</td>
						<td>实际违章押金：￥${(carPrice.rulemoney)!''}</td>
					</tr >
					<tr width="200" height="50px">
						<td>实际取车时间：<input type="text" value="${(info.realbttime)!''}" id="realbttime" readonly></td>
						<td colspan="2">实际还车时间：<input type="text" id="realettime" value="${(info.realettime)!''}" readonly></td>
						<td>实际支付：￥${(readyMoney)!''}</td>
					</tr>
					<tr width="200" height="50px">
						<td>扣除超时费用：￥<input type="text" id="returntimeout" value="${(info.returntimeout)!''}" readonly /></td>
						<td colspan="2">扣除车损费用：￥<input type="text" id="returndamage" value="${(info.returndamage)!''}" readonly/></td>
						<td width="350"><font color="red" size="4">结余退款：￥<span id="return" ></span></font></td>
					</tr>
					<tr width="200" height="50px">
						<td colspan="3" >扣除违章费用：￥<input type="text" onmouseover="this.style.borderColor='black';this.style.backgroundColor='plum'" style="width: 106; height: 30" onmouseout="this.style.borderColor='black';this.style.backgroundColor='#ffffff'" style="border-width:1px;border-color=black" id="returnillegal" value="${(info.returnillegal)!''}" onkeyup="changeEvent()"/><font color="red" size="4">请输入数字，没有请输数字0</font></td>
					</tr>				
					<tr width="200" height="50px">
						<td></td>
						<td></td>
						<input type="hidden" id="realtotal" value="${(info.realtotal)!''}"/>
						<input type="hidden" id="orderstate" value="${(info.orderstate)!''}"/>
						<input type="hidden" id="orderid" value="${(info.orderid)!''}"/>
						<input type="hidden" id="creditnum" value="${(client.creditnum)!''}"/>
						<input type="hidden" id="uid" value="${(client.uid)!''}"/>
						<input type="hidden" id="memlevel" value="${(client.memlevel)!''}"/>
						<td align="left"><input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;确认还车&nbsp;&nbsp;" id="aa" /></td>
						<t></td>
					</tr>
			</div>
			</form>
	</div>
</div>
<#include "include/_footer.html">
</head>


<script type="text/javascript" language="javascript">
	var changeEvent = function(){
		var returnmoney=document.getElementById("return");
		returnmoney.innerHTML =document.getElementById("realtotal").value-document.getElementById("returnillegal").value;
	}
</script>
<script type="text/javascript" language="javascript">
//实现编辑功能
 $(function(){
 
	$("#aa").click(function(){
		var reg=new RegExp("^[0-9]*(\.[0-9]*|[eE][+-][0-9]*)$");
		var returnillegal=$("#returnillegal").val();
		if(!reg.test(returnillegal)){
			alert("违章费用：请输入数字");
			return false;	
			}
			if(!confirm('您确定还车审核通过吗？')){
			return false;
			}
		$.ajax({
                    type: "put",
                    contentType:"application/json",                 
                    url: "/orderstwo/${(info.orderid)!''}",
	            	data:JSON.stringify({
                             'returnillegal':$("#returnillegal").val(),
                             'returntimeout':$("#returntimeout").val(),
                             'returndamage':$("#returndamage").val(),
                             'creditnum':$("#creditnum").val(),
                             'memlevel':$("#memlevel").val(),
                             'uid':$("#uid").val(),
							 'orderstate':"5",
                             
                            }),
					success: function() { 
						alert("还车成功！");
						var index = parent.layer.getFrameIndex(window.name);
						parent.$("#searchOrders").click();
						parent.layer.close(index);
					}
          });
	});
});

</script>
</body>
</html>
